package fr.mywiki.view.array.cell.account;

import fr.mywiki.business.account.AccountLite;
import fr.mywiki.business.account.AccountManager;
import fr.mywiki.business.structure.StructureLite;
import fr.mywiki.model.ejbAdapter.Value;
import fr.mywiki.view.array.cell.CellType;

/**
 * Given an account, this cell type enables the display of its structure full
 * name.
 */
public class FullUserStructure implements CellType {
	public String compute(Value value) {
		AccountLite account = (AccountLite) value;
		try {
			StructureLite struct = AccountManager.getStructure(account);
			return struct.getFullName();
		} catch (Exception e) {
			return new String();
		}
	}

}
